<template>
  <el-config-provider :locale="locale" :size="size">
    <router-view />
  </el-config-provider>
</template>
<script>
import { ElConfigProvider } from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'

import { loadDeviceInfo } from '@/utils/deviceInfo'

export default {
  name: 'app',
  computed: {
    locale() {
      return zhCn
    },
    size() {
      return this.$store.getters.size
    },
  },
  components: {
    ElConfigProvider,
  },
  mounted() {
    this.$store.dispatch('theme/initTheme')

    loadDeviceInfo().then((res) => {
      this.$store.commit('device/SET_DEVICE', res)
    })
  },
}
</script>
